home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
3_qtips.zip
/
TECH13.MSG
< prev
next >
Wrap
Text File
|
1992-09-21
|
7KB
|
149 lines
A QEdit Tip from the SemWare Technical Support Staff
.. QEdit v2.15 Commands ..
Have you ever wanted to adjust some of your settings
temporarily? Have you wanted to turn off the sound while
performing a repeated find command? Have you wanted to find the
decimal code for a character? QEdit Advanced v2.15 lets you
accomplish these tasks and more! These additional general and
advanced macro commands increase the power of QEdit. The
following is a list of the commands added to QEdit in version
2.15 with a brief description of each, plus several examples.
General Commands:
~~~~~~~~~~~~~~~~
AsciiChart - Displays a scrollable ASCII chart on the screen.
ListFiles - Displays a list of the currently loaded files. To
switch to another file, move the cursor to the appropriate
file and press <Enter>. To resume editing the current file,
press <Escape>.
FirstNonWhite - Intended as a replacement and/or supplement to
the BegLine command. Places the cursor at the first
non-white character on the line, or column 1 if the line
doesn't have any non-white characters. "White" characters
are tabs or spaces. A useful macro would be:
Home MacroBegin BegLine JTrue done: FirstNonWhite done:
(Explanation: If already at the start of a line, go to the
first non-white character on the line; otherwise, if not
already at the start of a line, go to the start of the
line.)
Advanced Macro Commands:
~~~~~~~~~~~~~~~~~~~~~~~
The following commands, intended primarily for QEdit macro
writers, are designed to simplify the writing of certain kinds
of macros. This group of macro commands forces the indicated
mode or setting. If the setting is already in that condition,
they set QEdit's result code to TRUE; otherwise, they set it to
FALSE.
In some cases, a macro can behave differently based on the
currently set QEdit modes. The following three commands give
some control in establishing the proper environment so that
your macro will always work as intended.
SetInsMode - Sets Insert mode on. To set Insert mode "off" (that
is, set overwrite mode "on"), do the following: SetInsMode
ToggleInsert
SetAutoIndentMode - Sets AutoIndent mode "on". To set AutoIndent
mode off, do the following: SetAutoIndentMode ToggleIndent
SetWordWrapMode - Sets WordWrap mode "on". To set WordWrap mode
off, do the following: SetWordWrapMode ToggleWordWrap
The Find command sounds a tone when the search string cannot be
found. This can be irritating in the case of a long-running
macro that may possibly execute hundreds of finds that fail. The
following commands allow you to selectively turn the sound "on"
and "off".
SetSoundOn - Sets sound "on".
SetSoundOff - Sets sound "off".
Most macros execute dozens of QEdit commands, sometimes hundreds
of times. This can cause the screen to flash rapidly as the
macro runs. Not only is this disconcerting to watch, it actually
decreases the speed of some macros. The following commands allow
you to temporarily suspend or resume screen updating, while a
macro is running.
SetScreenOn - Turns screen updating "on".
SetScreenOff - Turns screen updating "off". You must turn screen
updating back on before your macro prompts for input, or if
there is some output from the macro that you want displayed
on the screen.
NOTE: QEdit will AUTOMATICALLY turn screen updating back on when
the macro has finished executing. Thus, it is not necessary to
issue the SetScreenOn command at the end of the macro.
Many times, it would be nice for a macro to force a few
settings, do its assigned task, and then restore the original
settings. The following commands allow you to do just that. Note
that each time SaveSettings is executed, the previous settings
saved with SaveSettings are overwritten.
SaveSettings - Saves the current settings of: Insert,
AutoIndent, WordWrap, Sound, and Screen Updating.
RestoreSettings - Restores the saved settings listed above.
The following commands set QEdit's result code to TRUE or FALSE
based on the condition being tested. These commands make certain
types of macro tests easier and more reliable.
isBegLine - Returns TRUE if the cursor is at column 1;
otherwise, FALSE is returned.
isEndLine - Returns TRUE if the cursor is past the last
non-white character on the current line; otherwise, FALSE is
returned, including the case when the cursor is on an empty
line.
isEmptyLine - Returns TRUE if the current line is empty or
contains only white space; otherwise, FALSE is returned.
isLastLine - Returns TRUE if the cursor is on the last line of
the currently edited file; otherwise, FALSE is returned.
isFirstLine - Returns TRUE if the cursor is on the first line of
the currently edited file; otherwise, FALSE is returned.
isCursorInBlock - Returns TRUE if the cursor is inside a marked
block; otherwise, FALSE is returned.
To demonstrate how these concepts tie together, consider the
following simple macro to delete all the blank lines in a marked
block. The cursor should be at the beginning of the block when
the macro is invoked.
^f9 MacroBegin
SetScreenOff * turn off screen for speed
begin:
isCursorInBlock jFalse done: * exit if not in block
isEmptyLine jFalse next: * skip if not empty line
isLastLine jTrue last: * special handling for last
* line
DelLine jump begin: * delete empty lines
next:
CursorDown jTrue begin: * try next line
jump done: *
last:
DelLine * delete the last line
done: * that's all, folks!
Matthew Giles (SemWare Technical Support)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you miss some of the previous Tips? Don't worry, you can
download QEdit Tips 1-13 (Filename: ALLQTIPS.ZIP) on the SemWare
Support BBS (404-641-8968).